import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: '/home',
    component: () => import('@/views/Layout/index.vue'),
    children: [
      {
        path: '/home',
        component: () => import('@/views/Home/index.vue'),
        meta: { title: '首页' }
      },
      {
        path: '/Usecheck',
        component: () => import('@/views/Usecheck/index.vue'),
        meta: { title: '我要查' }
      },
      {
        path: '/notify',
        component: () => import('@/views/Notify/index.vue'),
        meta: { title: '我要办' }
      },

      {
        path: '/user',
        component: () => import('@/views/User/index.vue'),
        meta: { title: '个人中心' }
      }
    ]
  },
  {
    path: '/VideoDisplay',
    component: () => import('@/views/VideoDisplay/index.vue'),
    meta: { title: '视频播放' }
  },
  {
    path: '/Announcement',
    component: () => import('@/views/Announcement/index.vue'),
    meta: { title: '公告查询' }
  },
  {
    path: '/Picture',
    component: () => import('@/views/Picture/index.vue'),
    meta: { title: '操作指南' }
  }
]
const createRouter = () => new Router({
  // 默认的路由模式是hash
  mode: 'history',
  // mode: 'history', // require service support 路由模式、hash、history、abstract
  // 路由表
  routes
})
const router = createRouter()

export default router
